<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>ForuMall</title>
    <link rel="stylesheet" href="/static/index/css/swiper-3.4.2.min.css">
    <link rel="stylesheet" href="/static/index/css/GL.css">
    <script src="/static/index/js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>

    <script src="/static/index/js/swiper-3.4.2.jquery.min.js" type="text/javascript" charset="utf-8"></script>

    <script src="/static/index/js/swiper-3.4.2.min.js"></script>

</head>
<header>
    <div>
        <!--头部-->
        <div class="header_head">
            <div class="header_head_box">
                <!--            <a href="#" class="img"><img src="/static/index/img/logo.jpg"/></a>-->
                <b class="header_head_p">
                    <div class="header_head_p_cs">

                    </div>
                </b>
                <ul>
                    <li>
                        <a th:if="${session.loginUser != null}">欢迎, [[${session.loginUser.nickname}]]</a>
                        <a th:if="${session.loginUser == null}" href="http://auth.forumall.com/login.html">点击登录</a>
                    </li>
                    <li>
                        <a th:if="${session.loginUser == null}" href="http://auth.forumall.com/reg.html"
                           class="li_2">点击注册</a>
                    </li>
                    <li>
                        <a th:if="${session.loginUser != null}" href="http://auth.forumall.com/loguot.html"
                           class="li_2">立即退出</a>
                    </li>
                    <span>|</span>
                    <li>
                        <a href="http://member.forumall.com/memberOrder.html">我的订单</a>
                    </li>
                </ul>
            </div>
        </div>
        <!--搜索导航-->
        <div class="header_sous">
            <div class="header_form">
                <input id="searchText" type="text" placeholder=""/>
                <a href="javascript:search();"><img src="/static/index/img/img_09.png"/></a>
            </div>
            <div class="header_ico">
                <div class="header_gw">
                    <img src="/static/index/img/img_15.png"/>
                    <span><a href="http://cart.forumall.com/cart.html">我的购物车</a></span>
                </div>
            </div>
            <div class="header_form_nav">
            </div>
            <nav>
            </nav>
        </div>
        <!--轮播主体内容-->
        <div class="header_main">
            <div class="header_banner">
                <div class="header_main_left">
                    <ul>
                        <li th:each="category : ${categories}">
                            <a href="#" class="header_main_left_a" th:attr="ctg-data = ${category.catId}"><b
                                    th:text="${category.name}"></b></a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</header>

<div class="section_second">
    <!-- 第一层 -->
    <div class="section_second_header">
        <div class="section_second_header_left">
<!--            <p></p>-->
            <span class="">秒杀商品</span>
            <span>速来抢购</span>
            <span>
        </span>
        </div>
        <div class="section_second_header_right">

        </div>
    </div>
    <div class="section_second_list">
        <div class="swiper-container swiper_section_second_list_left">
            <div class="swiper-wrapper">
                <div class="swiper-slide">
                    <!-- 动态拼装秒杀商品信息 -->
                    <ul id="seckillSkuContent"></ul>
                </div>
                <div class="swiper-slide">
                </div>
            </div>
        </div>
        <ul class="section_second_list_right">
            <li>
            </li>
            <li>
            </li>
            <div class="section_second_list_right_button">
            </div>
        </ul>
    </div>
</div>


</body>
<script type="text/javascript">
    function search() {
        var keyword = $("#searchText").val()
        window.location.href = "http://search.forumall.com/list.html?keyword=" + keyword;
    }

    $.get("http://seckill.forumall.com/getCurrentSeckillSkus", function (res) {
        if (res.data.length > 0) {
            res.data.forEach(function (item) {
                $("<li onclick='toDetail(" + item.skuId + ")'></li>").append($("<img style='width: 130px; height: 130px' src='" + item.skuInfo.skuDefaultImg + "' />"))
                    .append($("<p>" + item.skuInfo.skuTitle + "</p>"))
                    .append($("<span>" + item.seckillPrice + "</span>"))
                    .append($("<s>" + item.skuInfo.price + "</s>"))
                    .appendTo("#seckillSkuContent");
            })
        }
    })

    function toDetail(skuId) {
        location.href = "http://item.forumall.com/" + skuId + ".html";
    }

</script>
<script type="text/javascript" src="/static/index/js/text.js"></script>
<script type="text/javascript" src="/static/index/js/header.js"></script>
<script type="text/javascript" src="/static/index/js/secend.js"></script>
<script type="text/javascript" src="/static/index/js/zz.js"></script>
<script type="text/javascript" src="/static/index/js/index.js"></script>
<script type="text/javascript" src="/static/index/js/left,top.js"></script>
<script type="text/javascript" src="/static/index/js/catalogLoader.js"></script>
</html>